package com.novellotus.iov.carvice.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Rich on 2017/10/24.
 */

public class RepairItemBean implements Parcelable {

    private String faults;
    private String reason;
    private String programme;
    private String faultsKey;
    private List<String> reasonCode;
    private List<String> programmeCode;
    private boolean add;
    private boolean isOpen = true;


    public List<String> getReasonCode() {
        return reasonCode;
    }

    public List<String> getProgrammeCode() {
        return programmeCode;
    }

    public void setReasonCode(List<String> reasonCode) {
        this.reasonCode = reasonCode;
    }

    public void setProgrammeCode(List<String> programmeCode) {
        this.programmeCode = programmeCode;
    }

    public boolean isOpen() {
        return isOpen;
    }

    public void setOpen(boolean open) {
        isOpen = open;
    }

    public void setFaultsKey(String faultsKey) {
        this.faultsKey = faultsKey;
    }

    public String getFaultsKey() {
        return faultsKey;
    }

    public void setFaults(String faults) {
        this.faults = faults;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public void setProgramme(String programme) {
        this.programme = programme;
    }

    public void setAdd(boolean add) {
        this.add = add;
    }

    public String getFaults() {
        return faults;
    }

    public String getReason() {
        return reason;
    }

    public String getProgramme() {
        return programme;
    }

    public boolean isAdd() {
        return add;
    }

    public RepairItemBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.faults);
        dest.writeString(this.reason);
        dest.writeString(this.programme);
        dest.writeString(this.faultsKey);
        dest.writeStringList(this.reasonCode);
        dest.writeStringList(this.programmeCode);
        dest.writeByte(this.add ? (byte) 1 : (byte) 0);
        dest.writeByte(this.isOpen ? (byte) 1 : (byte) 0);
    }

    protected RepairItemBean(Parcel in) {
        this.faults = in.readString();
        this.reason = in.readString();
        this.programme = in.readString();
        this.faultsKey = in.readString();
        this.reasonCode = in.createStringArrayList();
        this.programmeCode = in.createStringArrayList();
        this.add = in.readByte() != 0;
        this.isOpen = in.readByte() != 0;
    }

    public static final Creator<RepairItemBean> CREATOR = new Creator<RepairItemBean>() {
        @Override
        public RepairItemBean createFromParcel(Parcel source) {
            return new RepairItemBean(source);
        }

        @Override
        public RepairItemBean[] newArray(int size) {
            return new RepairItemBean[size];
        }
    };
}
